Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4886] Allow text/plain for csv uploads #4940

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

vaszig
Copy link
Contributor

@vaszig vaszig commented Dec 17, 2024

Closes #4886

Changes

  • Updated MimeTypeValidator to treat files as csv in specific circumstances.

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Dockerfile/scripts

    • Updated the Dockerfile with the necessary scripts from the ./bin folder
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

There is a problem defining that a file is text/plain or text/csv.

We decided to make some extra checks in order to be closer to that
conclusion because a lot of csv files are not created properly
(according to the proper structure, delimiters etc.) and are treated as
text/plain from magic library.
@vaszig vaszig added the needs-backport Fix must be backported to stable release branch label Dec 17, 2024
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.61%. Comparing base (486d9cb) to head (57fabe8).
Report is 19 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4940      +/-   ##
==========================================
- Coverage   96.62%   96.61%   -0.01%     
==========================================
  Files         760      760              
  Lines       25818    25819       +1     
  Branches     3382     3383       +1     
==========================================
- Hits        24947    24946       -1     
- Misses        606      608       +2     
  Partials      265      265              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vaszig vaszig merged commit f8095b4 into master Dec 18, 2024
32 of 33 checks passed
@vaszig vaszig deleted the fix/4886-windows-users-cannot-upload-csv-files branch December 18, 2024 13:35
vaszig added a commit that referenced this pull request Dec 18, 2024
There is a problem defining that a file is text/plain or text/csv.

We decided to make some extra checks in order to be closer to that
conclusion because a lot of csv files are not created properly
(according to the proper structure, delimiters etc.) and are treated as
text/plain from magic library.

Backport-of: #4940
vaszig added a commit that referenced this pull request Dec 18, 2024
There is a problem defining that a file is text/plain or text/csv.

We decided to make some extra checks in order to be closer to that
conclusion because a lot of csv files are not created properly
(according to the proper structure, delimiters etc.) and are treated as
text/plain from magic library.

Backport-of: #4940
@vaszig
Copy link
Contributor Author

vaszig commented Dec 18, 2024

Backports:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backport Fix must be backported to stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows users cannot upload csv files
2 participants